home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7418 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  51 lines

  1. Path: news1.is.net!news
  2. From: rob@america.net (Rob Garner)
  3. Newsgroups: comp.lang.c++,comp.os.ms-windows.programmer.tools.mfc
  4. Subject: Re: Getting functions out of libraries to work
  5. Date: Fri, 23 Feb 1996 06:02:07 GMT
  6. Organization: Cheyenne Software
  7. Message-ID: <312d57eb.11400999@news1.is.net>
  8. References: <312BBC29.6772@uni.massey.ac.nz>
  9. Reply-To: rob@america.net
  10. NNTP-Posting-Host: 204.180.18.189
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. Nigel.Ramsay.1@massey.ac.nz wrote:
  14.  
  15. >Hi,
  16. >
  17. >I am trying to get some functions out of a library to work. The problem 
  18. >is that I keep getting an "unresolved external" error whenever I try to 
  19. >call the functions.
  20. >
  21. >The funny thing is that it works fine when I compile under just C.
  22. >
  23. >I am using Microsoft Visual C++ 1.0, running under Windows 95.
  24. >
  25.  
  26. the function prototypes that you wish to call must be declared
  27.     extern "C"
  28.  
  29. try:
  30.  
  31. extern "C"
  32. {
  33.     void foo1(void);
  34.     void foo2(void);
  35. }
  36.  
  37. or
  38.  
  39. extern "C" void foo1(void);
  40.  
  41. later,
  42. rob
  43.  
  44.  
  45. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  46. The crux of the matter is the apostrophe.
  47.                                   - Frank Zappa
  48.  
  49. rob@america.net
  50. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  51.